home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / ewl / ewl_password.h < prev    next >
C/C++ Source or Header  |  2006-01-09  |  1KB  |  60 lines

  1. #ifndef __EWL_PASSWORD_H__
  2. #define __EWL_PASSWORD_H__
  3.  
  4. /**
  5.  * @file ewl_password.h
  6.  * @defgroup Ewl_Password Password: A Single Line Text Password Widget
  7.  * @brief Defines the Ewl_Password class to allow for single line obscured text.
  8.  *
  9.  * @{
  10.  */
  11.  
  12. /**
  13.  * @themekey /password/file
  14.  * @themekey /password/group
  15.  */
  16.  
  17. /**
  18.  * Inherits from the Ewl_Widget and provides single line editable text.
  19.  */
  20. typedef struct Ewl_Password Ewl_Password;
  21.  
  22. /**
  23.  * @def EWL_PASSWORD(password)
  24.  * Typecasts a pointer to an Ewl_Password pointer.
  25.  */
  26. #define EWL_PASSWORD(password) ((Ewl_Password *) password)
  27.  
  28. /**
  29.  * @struct Ewl_Password
  30.  * Inherits from the Ewl_Entry and extends it to obscure the text.
  31.  */
  32. struct Ewl_Password
  33. {
  34.     Ewl_Entry  entry; /**< Inherit from Ewl_Entry */
  35.     char      *real_text; /**< The password contents */
  36.     char       obscure; /**< Character displayed for password characters */
  37. };
  38.  
  39. Ewl_Widget    *ewl_password_new(void);
  40. int         ewl_password_init(Ewl_Password *e);
  41.  
  42. void         ewl_password_text_set(Ewl_Password *e, const char *t);
  43. char        *ewl_password_text_get(Ewl_Password *e);
  44.  
  45. void         ewl_password_obscure_set(Ewl_Password *e, char o);
  46. char         ewl_password_obscure_get(Ewl_Password *e);
  47.  
  48. /*
  49.  * Internally used callbacks, override at your own risk.
  50.  */
  51. void ewl_password_key_down_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  52. void ewl_password_destroy_cb(Ewl_Widget *w, void *ev_data, void *user_data);
  53.  
  54. /**
  55.  * @}
  56.  */
  57.  
  58. #endif                /* __EWL_PASSWORD_H__ */
  59.  
  60.